VERSION 5.00
Begin VB.Form frmAlphaWebsiteGuide 
   Caption         =   "Alpha Website Guide"
   ClientHeight    =   5805
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   8910
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   5805
   ScaleWidth      =   8910
   Begin VB.CommandButton cmdGetInit 
      Caption         =   "Get Inititial Urls"
      Height          =   615
      Left            =   1080
      TabIndex        =   0
      Top             =   480
      Width           =   1695
   End
End
Attribute VB_Name = "frmAlphaWebsiteGuide"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdGetInit_Click()
    Dim rs As New ADODB.Recordset
    Dim cn As New ADODB.Connection
    Dim sql As String
    Dim sFeed As String
    Dim ArrDetails() As String
    
    MsgBox "You are going to upload all website urls to database, it may take long time", vbOKOnly, SOFT_TITLE
    
    Call Cn2Oversea(cn)
    On Error GoTo openDB
    sql = "SET NAMES gbk"
    Call CloseRecordSet(rs)
    OperateDatabase rs, cn, sql
openDB:
    
    
    Open "1m-dos.csv" For Input As #5
    Do Until EOF(5)
        Line Input #5, sFeed
        ArrDetails = Split(sFeed, ",")
        sql = "INSERT INTO `alphaW`(`url`) VALUES ('" & ArrDetails(1) & "')"
        Call CloseRecordSet(rs)
        OperateDatabase rs, cn, sql
    Loop
    Close #5
    
    cn.Close
End Sub


Private Sub CloseRecordSet(ByRef rs As ADODB.Recordset)
On Error GoTo NoErr
        rs.Close
NoErr:
End Sub
